import { PivotSheet, S2Options } from '@antv/s2';
import {useEffect} from 'react'
import { S2DataConfig } from '@antv/s2';
import { SheetComponent, SheetComponentOptions } from '@antv/s2-react';
import '@antv/s2-react/dist/style.min.css';
import res from './data.js'
export default ()=>{
    const s2Options: SheetComponentOptions = {
        width: 600,
        height: 480,
        interaction: {
          copy: { enable: true },
        },
      };
  
      const s2DataConfig: S2DataConfig = {
        fields: {
          rows: ['province', 'city'],
          columns: ['type', 'sub_type'],
          values: ['number'],
        },
        meta: res.meta,
        data: res.data,
      };
    return <SheetComponent
        dataCfg={s2DataConfig}
        options={s2Options}
        header={{
        export: {
            open: true,
        },
        }}
        adaptive={false}
    />
}